// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_MST_PRODUCT
// * CreateDate    : 2012/12/27 11:05:30
// * Creater       : MstProductEntity
// * LastChangeDate: 2012/12/27 11:05:30
// * LastChanger   : 2012/12/27 11:05:30
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class MstProductEntity : EntityBase
    {
        public MstProductTable TableSchema
        {
            get
            {
                return MstProductTable.Current;
            }
        }

        public MstProductEntity()
        {

        }

        public MstProductEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.ProductTypeId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_TYPE_ID"]));
            this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
            this.ProductSpecIn = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_IN"]));
            this.ProductSpecOut = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_OUT"]));
            this.ProductName = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_NAME"]));
            this.SuggestPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUGGEST_PRICE"]));
            this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
            this.Weight = Convert.ToDecimal(CommonFunctions.ToObject(dr["WEIGHT"]));
            this.Size = Convert.ToDecimal(CommonFunctions.ToObject(dr["SIZE"]));
            this.DiameterOut = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_OUT"]));
            this.DiameterIn = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_IN"]));
            this.Length = Convert.ToDecimal(CommonFunctions.ToObject(dr["LENGTH"]));
            this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
            this.MinorUnit = Convert.ToString(CommonFunctions.ToObject(dr["MINOR_UNIT"]));
            this.Formual = Convert.ToDecimal(CommonFunctions.ToObject(dr["FORMUAL"]));
            this.Description = Convert.ToString(CommonFunctions.ToObject(dr["DESCRIPTION"]));
            this.DeleteFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["DELETE_FLAG"]));
            this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
            this.TypeName = Convert.ToString(CommonFunctions.ToObject(dr["TYPE_NAME"]));
            this.TypeCode = Convert.ToString(CommonFunctions.ToObject(dr["TYPE_CODE"]));
            this.StdName = Convert.ToString(CommonFunctions.ToObject(dr["STD_NAME"]));
            this.StdCode = Convert.ToString(CommonFunctions.ToObject(dr["STD_CODE"]));
            this.RootCodeType = Convert.ToString(CommonFunctions.ToObject(dr["ROOT_CODE_TYPE"]));
            this.FlowCode = Convert.ToInt32(CommonFunctions.ToObject(dr["FLOW_CODE"]));
        }

        public MstProductEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.ProductTypeId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_TYPE_ID"]));
            this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
            this.ProductSpecIn = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_IN"]));
            this.ProductSpecOut = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_OUT"]));
            this.ProductName = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_NAME"]));
            this.SuggestPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUGGEST_PRICE"]));
            this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
            this.Weight = Convert.ToDecimal(CommonFunctions.ToObject(dr["WEIGHT"]));
            this.Size = Convert.ToDecimal(CommonFunctions.ToObject(dr["SIZE"]));
            this.DiameterOut = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_OUT"]));
            this.DiameterIn = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_IN"]));
            this.Length = Convert.ToDecimal(CommonFunctions.ToObject(dr["LENGTH"]));
            this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
            this.MinorUnit = Convert.ToString(CommonFunctions.ToObject(dr["MINOR_UNIT"]));
            this.Formual = Convert.ToDecimal(CommonFunctions.ToObject(dr["FORMUAL"]));
            this.Description = Convert.ToString(CommonFunctions.ToObject(dr["DESCRIPTION"]));
            this.DeleteFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["DELETE_FLAG"]));
            this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
            this.TypeName = Convert.ToString(CommonFunctions.ToObject(dr["TYPE_NAME"]));
            this.TypeCode = Convert.ToString(CommonFunctions.ToObject(dr["TYPE_CODE"]));
            this.StdName = Convert.ToString(CommonFunctions.ToObject(dr["STD_NAME"]));
            this.StdCode = Convert.ToString(CommonFunctions.ToObject(dr["STD_CODE"]));
            this.RootCodeType = Convert.ToString(CommonFunctions.ToObject(dr["ROOT_CODE_TYPE"]));
            this.FlowCode = Convert.ToInt32(CommonFunctions.ToObject(dr["FLOW_CODE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return MstProductTable.Current;
            }
        }

        #region Perporty List
        public string ProductId
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_ID)); }
            set { SetData(MstProductTable.C_PRODUCT_ID, value); }
        }

        public string ProductTypeId
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_TYPE_ID)); }
            set { SetData(MstProductTable.C_PRODUCT_TYPE_ID, value); }
        }

        public string ProductCode
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_CODE)); }
            set { SetData(MstProductTable.C_PRODUCT_CODE, value); }
        }

        public string ProductSpecIn
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_SPEC_IN)); }
            set { SetData(MstProductTable.C_PRODUCT_SPEC_IN, value); }
        }

        public string ProductSpecOut
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_SPEC_OUT)); }
            set { SetData(MstProductTable.C_PRODUCT_SPEC_OUT, value); }
        }

        public string ProductName
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_NAME)); }
            set { SetData(MstProductTable.C_PRODUCT_NAME, value); }
        }

        public decimal SuggestPrice
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_SUGGEST_PRICE)); }
            set { SetData(MstProductTable.C_SUGGEST_PRICE, value); }
        }

        public string Material
        {
            get { return Convert.ToString(GetData(MstProductTable.C_MATERIAL)); }
            set { SetData(MstProductTable.C_MATERIAL, value); }
        }

        public decimal Weight
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_WEIGHT)); }
            set { SetData(MstProductTable.C_WEIGHT, value); }
        }

        public decimal Size
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_SIZE)); }
            set { SetData(MstProductTable.C_SIZE, value); }
        }

        public decimal DiameterOut
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_DIAMETER_OUT)); }
            set { SetData(MstProductTable.C_DIAMETER_OUT, value); }
        }

        public decimal DiameterIn
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_DIAMETER_IN)); }
            set { SetData(MstProductTable.C_DIAMETER_IN, value); }
        }

        public decimal Length
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_LENGTH)); }
            set { SetData(MstProductTable.C_LENGTH, value); }
        }

        public string Unit
        {
            get { return Convert.ToString(GetData(MstProductTable.C_UNIT)); }
            set { SetData(MstProductTable.C_UNIT, value); }
        }

        public string MinorUnit
        {
            get { return Convert.ToString(GetData(MstProductTable.C_MINOR_UNIT)); }
            set { SetData(MstProductTable.C_MINOR_UNIT, value); }
        }

        public decimal Formual
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_FORMUAL)); }
            set { SetData(MstProductTable.C_FORMUAL, value); }
        }

        public string Description
        {
            get { return Convert.ToString(GetData(MstProductTable.C_DESCRIPTION)); }
            set { SetData(MstProductTable.C_DESCRIPTION, value); }
        }

        public int DeleteFlag
        {
            get { return Convert.ToInt32(GetData(MstProductTable.C_DELETE_FLAG)); }
            set { SetData(MstProductTable.C_DELETE_FLAG, value); }
        }

        public string MaterialCode
        {
            get { return Convert.ToString(GetData(MstProductTable.C_MATERIAL_CODE)); }
            set { SetData(MstProductTable.C_MATERIAL_CODE, value); }
        }

        public string TypeName
        {
            get { return Convert.ToString(GetData(MstProductTable.C_TYPE_NAME)); }
            set { SetData(MstProductTable.C_TYPE_NAME, value); }
        }

        public string TypeCode
        {
            get { return Convert.ToString(GetData(MstProductTable.C_TYPE_CODE)); }
            set { SetData(MstProductTable.C_TYPE_CODE, value); }
        }

        public string StdName
        {
            get { return Convert.ToString(GetData(MstProductTable.C_STD_NAME)); }
            set { SetData(MstProductTable.C_STD_NAME, value); }
        }

        public string StdCode
        {
            get { return Convert.ToString(GetData(MstProductTable.C_STD_CODE)); }
            set { SetData(MstProductTable.C_STD_CODE, value); }
        }

        public string RootCodeType
        {
            get { return Convert.ToString(GetData(MstProductTable.C_ROOT_CODE_TYPE)); }
            set { SetData(MstProductTable.C_ROOT_CODE_TYPE, value); }
        }

        public int FlowCode
        {
            get { return Convert.ToInt32(GetData(MstProductTable.C_FLOW_CODE)); }
            set { SetData(MstProductTable.C_FLOW_CODE, value); }
        }

        #endregion
    }


}

